#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int prime[N];
bool st[N];
int n;
void fun()
{
	int cnt = 0;
	for (int i = 2; i <= N; i++) {
		if (!st[i]) {
			//prime[cnt++] = i;
			prime[i] = 1;
			for (int j = i * 2; j <= N; j += i) {
				st[j] = 1;
			}
		}
	}
}
int main()
{
	fun();
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (prime[i]) {
			//cout << i << " ";
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}